<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Route::get('/pp','PersonController@info');
Route::get('/pp/test','PersonController@test');
Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::group(['namespace' => 'Admins'],function() {
    // 在 "App\Http\Controllers\Admins" 命名空间下的控制器
    Route::post('/admins/sys/login','SysController@login');
    Route::get('/admins/sys/loginfrom','SysController@loginFrom');
    Route::get('/admins/sys/loginout','SysController@loginOut');
    Route::get('/admins/sys/forgotpassword','SysController@forgotPassword');
    Route::get('/admins/sys/regeditfrom',function(){return view("admins/sys/regeditFrom");});

});

Route::group(['prefix'=>'admins','namespace' => 'Admins','middleware'=>['cookie']],function() {
    //与上面路由相比需要登录验证
    Route::get('/main','SysController@main');
    Route::get('/welcome','SysController@welcome');

    Route::get('/report/reportupload','ReportController@ReportUpload');
    Route::post('/report/upload','ReportController@upload');
    Route::get('/report/getexcel','ReportController@getExcel');
    Route::get('/report/filelist','ReportController@fileList');
    Route::get('/report/filedel','ReportController@fileDel');
    Route::get('/report/xlsyn','ReportController@xlSyn');
    Route::get('/report/reportlist','ReportController@reportList');
    Route::get('/report/reportdel','ReportController@reportDel');
    Route::get('/report/payment','ReportController@payment');
    Route::post('/report/paying','ReportController@paying');
    Route::get('/report/paymentrecord','ReportController@paymentRecord');


    Route::get('/promoter/addpromoterform','PromoterController@addPromoterForm');
    Route::post('/promoter/addpromoter','PromoterController@addPromoter');
    Route::get('/promoter/getlists','PromoterController@getList');
    Route::get('/promoter/getjsonlist','PromoterController@getJsonList');
    Route::get('/promoter/editpromoterform','PromoterController@editPromoterForm');
    Route::post('/promoter/editpromoter','PromoterController@editPromoter');
    Route::get('/promoter/delpromoter','PromoterController@delPromoter');

});


Route::group(['prefix'=>'admins','middleware'=>['cookie']],function(){
    //大淘客控制下路由
    Route::group(['prefix'=>'dtk'],function(){
        Route::get('/getapi','DtkAPIController@getApiData');
        Route::get('/startsyn','DtkAPIController@startSyn');
        Route::get('/syndata','DtkAPIController@synData');
        Route::get('/syn','DtkAPIController@syn');
        Route::get('/del','DtkAPIController@del');
        Route::get('/getist','DtkAPIController@getList');
        Route::get('/deldtkdata','DtkAPIController@delDtkData');



    });
    //轻淘客控制下路由
    Route::group(['prefix'=>'qtk'],function(){
        Route::get('/getapi','qtkAPIController@getApi');
    });
    Route::group(['prefix'=>'promoter'],function(){
        Route::get('/getlist','PromoterController@getList');

    });
});




Route::group(['prefix'=>'ajax','namespace' => 'Ajax'],function() {

});

Route::group(['prefix'=>'home','namespace' => 'Home','middleware'=>['']],function() {
    // 在 "App\Http\Controllers\Home" 命名空间下的控制器

});

Route::group(['prefix'=>'auth','namespace' => 'Auth'],function(){
    Route::get('/qq/login','QqconntectController@login');
    Route::get('/qq/index','QqconntectController@index');
    Route::get('/qq/callback','QqconntectController@callback');

});
Route::group(['prefix'=>'home','namespace' => 'Home'],function(){
    Route::get('/getlist','ProductsController@getlist');
    Route::get('/testvue','ProductsController@testvue');
    Route::get('/personinfo/index','PersoninfoControler@index');
    Route::get('/getimg/{goodsId}','ProductsController@getImgByGoodsId');

});

Route::group(['prefix'=>'test'],function(){
    Route::get('/startsyn','DtkAPIController@startSyn');
    Route::get('/syndata','DtkAPIController@synData');
    Route::get('/getlist','DtkAPIController@getList');

});
Route::group(['prefix'=>'test','namespace' => 'Admins'],function(){
    Route::get('/getexcel','ReportController@getExcel');
    Route::get('/getlist','PromoterController@getList');
    Route::get('/getjsonlist','PromoterController@getJsonList');
    Route::get('/addpromoterform','PromoterController@addPromoterForm');
});
